import {
  request
} from "../../request/index.js";
Page({
  data: {
    swiperList: [],
    catesList: [],
    floorList:[]
  },
  onLoad(options) {
    this.getSwiperList();
    this.getCatesList();
    this.getFloorList();
  },
  async getSwiperList() {
    // wx.request({
    //   url: "https://api-hmugo-web.itheima.net/api/public/v1/home/swiperdata",
    //   success: res => {
    //     console.log(res);
    //     this.setData({
    //       swiperList:res.data.message
    //     })
    //   }
    // })
    let data = await request({
      url: "https://api-hmugo-web.itheima.net/api/public/v1/home/swiperdata"
    })
    this.setData({
      swiperList: data.data.message
    })
  },
  async getCatesList() {
    let data = await request({
      url: "https://api-hmugo-web.itheima.net/api/public/v1/home/catitems"
    })
    this.setData({
      catesList: data.data.message
    })
  },
  async getFloorList() {
    let data = await request({
      url: "https://api-hmugo-web.itheima.net/api/public/v1/home/floordata"
    })
    this.setData({
      floorList: data.data.message
    })
  },
})